﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ContactList.aspx.cs" Inherits="OnATous.ContactList" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <span id="credits"><span class="variable">
        <asp:Label ID="numberofcredits" runat="server"></asp:Label></span> crédits</span>
    <span id="nbvotes"><span class="variable">
        <asp:Label ID="numberofvotes" runat="server"></asp:Label></span> contacts vous ont
        noté</span>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">

    <script type="text/javascript">
        jQuery.expr[':'].Contains = function (a, i, m) {
            return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase()) >= 0;
        };

        $(document).ready(function () {
            $('#srch').keyup(function () {
                if ($(this).val() == '') {
                    $('#mainlist li').show();
                }
                else {
                    $('#mainlist li').hide();
                    $('#mainlist li span.name:Contains(' + $(this).val() + ')').parents('li').show();
                }
            });
        });
    </script>

    <div id="mainlist">
        <asp:Button ID="NotedContactsButton" runat="server" Text="Contacts notés" OnClick="ShowNotedContacts" CssClass="buttonPage" />
        <asp:Button ID="NotNotedContactsButton" runat="server" Text="Contacts non notés" OnClick="ShowNotNotedContacts" CssClass="buttonPage" />
        <input id="srch" type="text" class="srch" />
        <ul id="alphalist">
            <asp:Repeater ID="ContactListRepeater" runat="server">
                <ItemTemplate>
                    <li>
                    <asp:ImageButton runat="server" CssClass="ImgButton" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "Photo") %>' OnClick="NoteContact" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Id") %>' />
                      <span class="name">
                        <%# DataBinder.Eval(Container.DataItem, "Pseudo")%>
                      </span>
                      <span class="info">
                        <span class="variable">
                            <%# DataBinder.Eval(Container.DataItem, "Credits") %>
                            contacts ont voté
                        </span>
                      </span>
                    </li>
                </ItemTemplate>
            </asp:Repeater>
        </ul>
    </div>
</asp:Content>
